The online racing simulator
Searching in All forums
(769 results)
Scawen
Developer
For people who experience slow mods downloads, I have done a test in Test Patch D10.

Internet research has yielded little. This test is based on very little evidence, but I think it's worth a go. You need to enable it in Misc Options.

https://www.lfs.net/forum/post/2035565#post2035565
Scawen
Developer
Test Patch D10

I've added an experimental option in Misc Options. Based purely on the suggestion in that link above, it seems worth a go. Let's see if it makes mod downloads any faster or slower for people who are far from Rotterdam and experience slow mod downloads.

Options... Misc... HTTP buffer test [EXPERIMENTAL]

https://www.lfs.net/forum/thread/102117
Last edited by Scawen, .
Scawen
Developer
In case any TCP gurus are reading, I have only set one socket option on the HTTP receive socket. The rest I have left at default.

The one option I have set is SO_RCVBUF:

int rx_size = 65536; // rx buffer size 64K (default is 8K)
setsockopt(SkinSocket, SOL_SOCKET, SO_RCVBUF, (const char *)&rx_size, sizeof(int));

I'm not certain where I have got the information that default is 8K. However, if I do query that value without setting it, I do get the answer 8K. Various posts I have read in the past suggest a buffer size of 64K is good so that's why I have set it.

This is contradicted by one post I found on Microsoft's site:
https://techcommunity.microsoft.com/t5/networking-blog/windows-network-performance-suffering-from-bad-buffering/ba-p/339668

But I'm struggling to find more info about it. I guess I could do a simple test of simply not setting that value, and we can check if your skin and mod downloads get faster or slower?

P.S. I've moved some off-topic posts. This thread is about the test patch.
Scawen
Developer
Quote from r3zp3k7 :All conditions were met. The pit stop was finished and the 0.7D6 user was spectating. The same was in reverse. Hard to tell how it happened though, because after the 0.7D6 user re-entered LFS.exe the bug was not found anymore. Anyway, if we find it again, I'll let you know. Tire physics is way more important for everyone, so please proceed in peace.

I've tested this now with a D and D9 version connected (to a D host). I did not encounter a problem taking over car, from D to D9 or from D9 to D. As nothing changed in that area, I will assume this is not related to the test patch and is extremely rare or related to conditions we don't know.

Quote from Tuttu The Dog :I do been seeming to face a problem after downloading the patches, My mod loading time is too slow and it times out so often.. And it happens in singleplayer too! and got to try 3 times to join a server minimum. This have never happened to me before, another player also seems to be facing this issue.

It is unlikely to be test patch related as nothing has changed with the download code. It's probably something on the internet at your end, our end or somewhere in the middle. Have you tried using a D (or other) backup exe to verify that the slow download does not occur with D?
Scawen
Developer
No, it is generated locally. I think the clue is that it is a translated message? Unless it's actually generated by your InSim program? I've looked in the code and can't see anything that would remove a dot from a user name, so was hoping for an easier reproduction.

I'm trying to do things in a simple way, rather than spending a long time creating fake user names, to try to reproduce the fault. This is to save me time as I have a lot of other things to work on. Maybe you could get your friend with a user name that starts with a dot to join a server to create a short MPR.

When i searched our system, I couldn't find a user called ".user1" so assumed it was an example and you are protecting the identity of the user?

A similar thing has happened on the test patch forum. A bug has been reported, I asked for a reproduction, but no-one is interested. That's fine but it'll take me longer to develop the tyre physics if I'm the only one reproducing obscure bugs.
Scawen
Developer
Hey super, please let me judge for myself what's important.

For the record, it's very important if the test patch has a bug in it that means people can't change drivers. Most useful would be to go out and test it. If there's a bug, I'll fix it. That's how it works.

EDIT: But I now notice that I said "D8" in previous post. Sorry about that, I should have said "D9" as it's the latest test patch. All I really want to ask is to test D9 driver changes, perhaps one player in D9 and the other in D. You are right, it doesn't matter about D6 or D8.
Last edited by Scawen, .
Scawen
Developer
Were all the conditions definitely met? In pit stop, etc. I could stop and test this using two user accounts but I'm in the middle of tyre physics so don't really want to stop at the moment, so if anyone else can test that would be appreciated. I'd suggest testing with D9 and D versions together. If all works then I'd suggest that all is OK.
Last edited by Scawen, . Reason : edit: originally wrote D8, meant to say D9
Scawen
Developer
Test Patch D9 is now available:

Interface:

FIX: Chat text in mods screen is now in front of interface buttons

Graphics:

Dust colour on grass and dirt tracks now uses a dirt colour
- previously used average colour of surface which looked odd
- smoke and dust acquire lighting colour from car's location

Multiplayer:

Stationary cars can now lag for longer (3 seconds) before vanishing
Team arrow colours on small map are now enabled by a host option
- option is not yet available but is coded as /teamarrows=no/yes

InSim:

IS_CPP packet with Time = 0 is instantly processed (not stored)
- allows it to be followed immediately by an IS_CPP with Time > 0
FIX: ZByte was not set in IS_OBH packet

https://www.lfs.net/forum/thread/102117
Scawen
Developer
Moved a few posts that are no longer needed.

I'm finishing a few more minor updates for the public test patch.
Scawen
Developer
Gentle reminders work better with me, rather than trying to ram it down my throat / rub my face in the shit or whatever metaphor.

I have a lot to do and I can get through more when I have peace of mind. Irritation makes me less able to get work done.

Everything is here on a list and I'm trying to get it done. You might have observed by now, I'm not really forgetful about things that have been mentioned on test patch threads. Regardless, I don't mind gentle reminders but a list of dumb insults isn't at all helpful.
Scawen
Developer
Thank you for the report.

I confirm there was a missing line of code where this byte should have been copied from an internal packet to the InSim packet. I've added that line so it'll be in any version that is released, 0.7D9 or later. It looks so simple at this point I will simply claim it is fixed, without actually testing it as I'm a bit busy with other things.

If you are using this on client side then you could get the required value in the next test patch (I'm not sure when, but we do have a test patch in progress, though I'm not very active on it). If you need it on server side, I'm not sure when that will be.
Scawen
Developer
Quote from Gutholz :Does there need to be this threshold?
Or could it be like each 0.1% damage adds 5 seconds?

It was already discussed, how I've added it in an extremely simple and quick way using the existing system.

Apparently I have made a mistake by moving such posts into the "no longer needed" thread:
https://www.lfs.net/forum/post/2031828#post2031828

I'm not wondering about things to add to the test patch. I'm fully immersed in the development version.

For anyone who hasn't followed the test patch process, this isn't me sitting around with nothing to do, randomly and suddenly thinking about pointless things to add to a test patch. In fact, it was all about one thing leading to another.

History of this test patch:

- some things were needed for MRc E-challenge
- therefore a test patch was required
- I have noticed a lot of concern about LFSLazy not working
- added a couple of the most requested features from LFSLazy
- one of those was engine damage display
- this inspired me to do a 5 minute update to allow engine repair
- this was discussed at length here before implementing

That's it. I don't want to put effort into refining it at this time.
Last edited by Scawen, . Reason : added quote
Scawen
Developer
Thank you for the reports and tests with long names. I tried uploading a simple test mod at some point, to confirm the issue. Victor found and fixed a bug relating to the long names. Something to do with not allowing enough space for the version identifier (like ~001). I guess that means only 23 character names were really possible.

I verified the fix with an upload and it seemed to work. Sorry it took a while, hope its sorted now.
Scawen
Developer
It seems that most think the engine damage number should not be displayed for remote cars. That would be a simple change and consistent with the tyre temperatures.

What about the point at which it changes from yellow to red? While that is not very important yet, it would become more important if we do engine repairs in pit stop. In that case the yellow amount of damage could count as "minor damage" and the red would would count as "major damage" and take longer. So then it becomes important to set that value correctly (currently 95%).

Although I'm still not sure about implementing engine repair, it seems simple enough and for for sim racing purposes and longer races, it would be good to be able to fix the engine.


By the way, for anyone who is worried about me working on the test patch, do not worry, I'm working on the dev version. Pausing to do a few minor changes in the public version (which also go into the development version) isn't really a problem.
Scawen
Developer
Quote from Eclipsed :I'm wondering what does this percentage say? If I damage the engine to 90%,do I have 90% of power at each revs range?

It seems worse than that. Like if it says 50% you really have quite a lot less power than 50%.

Rough explanation: It's more related to the 'input power' ignoring the internal resistance of the engine which stays the same.

Quote from Kanade :Would it be possible to get clutch temp & engine damage as dashboard warning icons?
Would love to be able to use them both for mods and with SimHub.

I would like to do that but I can't add the extra warning light position into the car files while maintaining compatibility so that must be done at a later time, when new cars will be incompatible with old versions for some other reason.

Quote from Facu23 :talking about minor and major damages, any chances to avoid cosmetic repairs to save time? like only repair suspensions and engine or solo suspensions.

I know what you mean but some of the 'cosmetic' repairs do correspond with suspension repairs. Anyway I think it's all a bit complicated for now as I have to be getting on with other things.


I'm not sure if I'll do engine repair in pit stops at this time. Still considering it. It would increase the pressure to release a new full version. This current test patch is fully compatible which means it can hang around here for a while and we can add a feature every now and then.
Scawen
Developer
I've made this appear beside the CT indicator, just an early test so far.

Naturally it comes out as a "Health" value that starts at 100% and goes down from there (if you downshift too early -> over rev). No change in the physics, this is only a display.

One bad shift affects it quite a lot, so I think one decimal place is enough. Maybe the straight percentage with no decimal place would be OK?

Opinions welcome, maybe I'll release a minor update with this tomorrow morning so you can have a go.

I was thinking the engine symbol could start grey then go yellow then red with more damage. Possibly if pit engine repair is implemented, the colours could line up with "minor damage" and "major damage".

Scawen
Developer
Semi-related to the maximum speed for gears, I read recently about another display from LFSLazy that can apparently be very useful. An engine damage display on screen.

Further reading:
MandulAA: https://www.lfs.net/forum/post/2013145#post2013145
pantiainen: https://www.lfs.net/forum/post/2013394#post2013394

I'm not saying I'll actually add it to this test patch, but I was wondering if an engine damage % (or the opposite, engine health %) could be displayed in a small box like the CT. I'm not sure if it really needs a number or just a bar like the CT. And it leads me to another question, if engine damage should be repaired in pit stops? It seems unrealistic but it's no less realistic than full suspension and perfect bodywork repair in the pits, so why not allow engine to be repaired too. It's something that can be "better" in racing sims than real life. I'm thinking when you have a 6 hour race and you do one dodgy gearchange, so now you have a weak engine for the next 5 hours. Disappointing and maybe not so bad if you could just pay for it with a pit stop.

I was thinking a small damage % could be included in "minor repairs" and a larger % would lead to "major repairs".

Well that is just a thought. Don't think it's wasted time as it affects the current public version and the version still in development. Also seems pretty easy to do though I haven't looked in the code yet.
Scawen
Developer
Thank you for the feedback.
I've reinstated the traditional LFS distortion / clip softening function in Test Patch D4.
https://www.lfs.net/forum/thread/102117
Test Patch D4 (now D48)
Scawen
Developer
WARNING: THIS IS A TEST

THIS DOES NOT CONTAIN NEW TYRE PHYSICS OR THE NEW GRAPHICS SYSTEM

PLEASE TEST BEFORE YOU POST

PLEASE... NO OFF TOPIC FEATURE REQUESTS!


Hello Racers,

Here is a new test patch: 0.7D48

Please read the list of changes below.

0.7D48 is compatible with 0.7D
- You CAN connect online with 0.7D
- You CAN play replays from 0.7D

Please back up or rename your LFS.exe from version D so you can revert to it if necessary.


Changes from D to D48:

Interface:

A small map is now displayed at Layout Square if there is a layout
New display in F9 / F10 views shows estimated laps given fuel use
Engine health (with colour code) is displayed in F9 / F10 views
F9 / F10 extra displays are now switchable (Options - Display)
Speedo and tacho are moved UP if required for extra displays
CT display now uses dot matrix font if translation allows it
Driver / fuel buttons in garage are now only shown if relevant
Speed at redline is displayed beside each gear ratio in setup
Simple versions of F11/F12 displays are now available during an SPR
A message shows the name of any mod that can't be loaded in an SPR
Four-character mod names are shown in results table instead of MOD
Downforce tab is now shown for all vehicles
- previously was only for those with adjustable wings
- shows an estimated maximum speed based on wind resistance
- note: the estimate does not consider rolling resistance
FIX: Crash when two events on calendar used same event image
FIX: Calendar time could be wrong near start of daylight saving
FIX: Small camera movement on releasing LMB after 2-button rotation
FIX: Chat text in mods screen is now in front of interface buttons
FIX: User names that start with '.' now correctly displayed in chat
FIX: Crash if /track command was used while generating AI path info
FIX: AI skill level always used Latin codepage in F11/F12 menus
FIX: Engine brake reduction had no effect for EV but was visible
FIX: /setlap command error if name coloured and number 4 chars long
FIX: Replays auto-named with special characters could appear wrong

Controls:

A force feedback display is shown below the pedals (bottom right)
FIX: Mouse wheel gearshifts are now equivalent to 100ms keypress

Game:

Possible to reset if an approaching vehicle is moving slowly enough
Reset is now possible during a pit stop if the state is "finished"
Speed limiter (at 80 km/h) can be manually enabled if no pit lane
Auto gear shift: downshifts are now done at slightly lower rpm
FIX: Auto shift *up* did not work if max power rpm above redline
FIX: Driver swap enabled very high speed limiter if no pit lane

Mods:

An EV charge/discharge power bar in place of the clutch bar
- only visible if Options - View - Show pedals is enabled

A new "Cleanup" mode in the mods screen
- you can select to keep latest mods and test mods
- there is not yet a feature to keep replay mods

Support for new options set per vehicle instead of by race class
Support for "hub" subobject that moves and rotates with a wheel
Support for new pit speed limiter flashing light option
One wheel drive and no anti-roll if wheels are staggered
Click Skin ID in garage colours tab to copy ID to clipboard
Hold CTRL in Garage: Mods button becomes Test (direct to Test mode)
Opening mods screen is prevented if a rating request is in progress
FIX: Mod with 27 character name appeared in mods screen Test mode
FIX: Crash if mod had more than 64 materials

Dashboards:

Engine damage light on dashboard is now available if set in editor
Support for new speedo and tacho style options (see editor notes)
Support for dashboard backing texture system, text colours, opacity
Can also set background colour without supplying a backing texture
New needle pivot texture works better on light coloured dashboards
Dashboard brightness should now be the same as in the editor
- this update also affects the RB4 and MRT5 (recently updated)
FIX: Text size on dashboard more closely matches text in editor
FIX: Brightness of multi function display now matches the editor

New steering model for bikes:

Improved handling and braking ability
- Feet down steering model up to 7 km/h
- Low speed model only from 7 km/h to 18 km/h
- Interpolated model from 18 km/h to 36 km/h
- High speed model only above 36 km/h
FIX: Steering glitch between feet down model and low speed model

AI vehicle control:

Improved braking prediction so less running wide at corners
- considers brake balance (which is not ideal for every corner)
- can result in better lap times due to improved line following
AI braking prediction now takes account of engine braking
AI can now ride motorbikes (a bit slowly due to safety margin)
AI will drive more gently when off track on a bad surface
Bikes slow to avoid taking off over large humps in the road
Avoid unnecessary downshifts by looking ahead to see if needed
FIX: Sometimes could reach a maximum speed and stop accelerating

AI misc:

Distance to vehicle considered dangerous now depends on length
Distance to vehicle considered safe is reduced at low speed
- should prevent long vehicles hitting the brakes on green light
- gaps between vehicles may be smaller when speed is below 20 m/s
AI can enter configs with no path (but will not drive)
AI can now enter the game with an object (to just sit there)
Better collision avoidance when close behind or beside others
Reset is available even after engine switched off after long wait
Message history is no longer enabled for AI path generation
FIX: AI can now reset if in contact with a stationary vehicle
FIX: Errors in fuel calculation related to "Refuelling allowed"
FIX: It was possible for the fuel calculation to report 0 stints
FIX: A hang generating path for a mod with "Max up" wrongly set

AI in pit lane:

Target speed 1 km/h slower in pit lane to avoid speeding by mistake
- was possible for a powerful car to overspeed shifting 1st to 2nd
Improved driving in pit lane when close behind other drivers
Avoid excessive downshifting when approaching speed limit zone
Approx 1 second safety margin entering pit lane to avoid speeding
Use speed limiter or throttle to avoid wheelspins causing speeding
Smoother transitions switching between main path and pit lane path
FIX: Choice of pit stop box was wrong (bug introduced in 0.7B)
FIX: Slow start / stuck in pit stop if max torque at very low rpm
FIX: Some mods would brake too gently and miss the pit stop point
FIX: Some mods would overshoot their pit garage when parking
FIX: Can now reset at the end of a pit stop (e.g. fallen bike)

AI overtaking:

Various improvements to improve the overtaking decisions
Overtakes are considered on a group instead of individuals
Better estimate of the possibility and duration of a pass
Pass decision from low speed now allows for acceleration
When planning a pass time is allowed to pull in after pass
More distant consideration of other vehicles at high speed
There should be fewer dangerous overtakes in braking zones
FIX: AI could get pointlessly stuck behind a slower vehicle

Regional downloading system:

We now have 3 download locations for mods (NL/JP/US)
Faster downloads if you are in N/S America or Asia/Oceania
Locations in Asia and Oceania will download mods from Japan
Locations in North and South America will download from USA
Download redirection is handled automatically by our server
Regional downloads can be disabled by a new Misc Option
Yellow redirect message is shown the first time you are redirected

Graphics:

Dust colour on grass and dirt tracks now uses a dirt colour
- previously used average colour of surface which looked odd
- smoke and dust acquire lighting colour from car's location
FIX: Mudguard / handlebar / trailing arm subobject could disappear

Physics:

Improved bike physics (affects lean angle and tyre forces)
Pit speed limiter now based on drive speed instead of world speed
- prevents wheelspins (e.g. at RO) pushing car over the speed limit
FIX: Narrow cars were sucked in when near fence or narrow barrier

Audio:

Tone variation limited to 0.99 to prevent an engine sound bug
Switched off experimental "Prevent clipping" option by default

Multiplayer:

Improved setting of tyre state after receiving a position packet
- previous location of tyre contact is better estimated (for forces)
- most noticeable when viewed car had not been on screen for a while
- e.g. after tabbing to another car or fast forwarding a replay

Misc option "Full physics for remote cars" is enabled by default
- low res physics previously used for cars other than the 4 nearest
- option approximately doubles CPU usage by physics in multiplayer
- could cause issues at turn 1 with many cars depending on PC power
- use profiler display to check CPU usage with the option enabled
- see profiler by pressing car icon then P in Misc/Graphics options

Engine damage repair in pit stop
- yellow counts as minor damage (6 seconds)
- red counts as major damage (12 seconds)

Team arrow colours on small map are now enabled by a host option
- arrows on non-race small map take colour of first name character
- option is not yet available but is coded as /teamarrows=no/yes

Cancel button and ESC key to cancel the process of joining a host
- the currently downloading skin or mod is allowed to finish first
Temporary (free) hosts are shown without colours in List of Hosts
Stationary cars can now lag for longer (3 seconds) before vanishing
FIX: Remote car using pit speed limiter did not move smoothly
FIX: Crash enabling filter in List of Hosts after all were disabled

InSim:

IS_CPP packet with Time = 0 is instantly processed (not stored)
- allows it to be followed immediately by an IS_CPP with Time > 0
FIX: ZByte was not set in IS_OBH packet

New commands:

/status none|F9|F10|F11|F12|next|prev - sets status screen
E.g. /status next will cycle through the F9 to F12 status screens
(you could assign it to a CTRL+ or ALT+ key and then a wheel button)

/liveset and /pitins - do the functions of F11 and F12 menus

You can use operators:
= (set value)
+= (add to value)
-= (subtract from value)

Examples:
/pitins ftyre = r3 : change front tyres to R3 in pit stop
/pitins rtyre = super : change rear tyres to road super
/pitins fpressure = 1.1 : set front tyre pressure to 1.1 bar
/pitins fpressure += 0.1 : increase requested pressure by 0.1 bar
/pitins cancel : cancel all pit instructions
/pitins tyres always : change all tyres
/pitins tyres 20 : change tyres if wear > 20%
/liveset bbal 60 : set brake balance to 60%
/liveset rarb -= 0.1 : decrease rear ant-roll bar by 0.1

Available options for /pitins:
fuel, tyres, repair, symmetric
ftyre, fcamber_l, fpressure_l, fcamber_r, fpressure_r, fwing
rtyre, rcamber_l, rpressure_l, rcamber_r, rpressure_r, rwing
cancel, fcamber, fpressure, rcamber, rpressure

/pitins pressure commands can accept unit (psi/bar) (no unit = bar)
E.g. /pitins fpressure 30 psi

Available options for /liveset:
bbal, farb, rarb

Multiple commands on single line:

Multiple commands can now be added on a single line which sometimes
can avoid the need for a script file, e.g. to set a button to
change tyres in pit stop, you could use a double command:
/pitins ftyre super /pitins rtyre super

NOTE: some commands cannot be followed by another command:
/say /echo /join /rcm /pass /msg /altf /ctrlf

Maximum length of command and F key text increased to 95 characters
Wider text display in CTRL+ and ALT+ tabs in controls screen

Translations:

Updated translations - thanks to our volunteer translators


INSTALLATION:

A FULL version of LFS 0.7D must already be installed


To install the PATCH using the SELF EXTRACTING ARCHIVE:

1) Move or save the patch into your main LFS folder
2) Double click the patch to extract it to that folder
3) When you see "Confirm File Replace" select "Yes to All"
4) Now you can start LFS in the normal way

NOTE: You can see if the patch is correctly installed when you run
the program (LFS.exe). At the bottom of the entry screen: 0.7D25


DOWNLOAD:

IF YOU ALREADY HAVE 0.7D:
PATCH 0.7D TO 0.7D48 (SELF EXTRACTING ARCHIVE)
https://www.lfs.net/file_lfs.p ... =LFS_PATCH_7D_TO_7D48.exe (1.5 MB)
Last edited by Scawen, .
Scawen
Developer
Thanks. I did not see this until today. There was a crash bug related to multiple events with the same image. That was an LFS bug but I came across it on my own, on 23rd December. Victor was able to avoid the crash by preventing double uses of the same image in the event list. The actual crash bug is now fixed in Test Patch D2.
Test Patch D2 (now D3) - Minor updates
Scawen
Developer
WARNING: THIS IS A TEST

THIS DOES NOT CONTAIN NEW TYRE PHYSICS OR THE NEW GRAPHICS SYSTEM

PLEASE TEST BEFORE YOU POST


Hello Racers,

Here is a new test patch: 0.7D3

The changes are listed below.

0.7D3 is compatible with 0.7D

- You CAN connect online with 0.7D
- You CAN play replays from 0.7D

Please back up or rename your LFS.exe from version D so you can revert to it if necessary.


Changes from 0.7D2 to 0.7D3:

Arrows on non-race small map take colour of first name character
Speed at redline is displayed beside gear ratios in setup screen


Changes from 0.7D to 0.7D2:

Audio:

Tone variation limited to 0.99 to prevent an engine sound bug
Switched off experimental "Prevent clipping" option by default
Removed an old distortion effect from the default sound output

Misc:

Speed limiter set to 80 km/h can be manually enabled if no pit lane
Reduced glitch of multiplayer cars after TAB or fast forward replay
A small map is now displayed in layout square if there is a layout
FIX: Driver swap enabled very high speed limiter if no pit lane
FIX: Crash when two events on calendar used same event image


INSTALLATION:

A FULL version of LFS 0.7D must already be installed


To install the PATCH using the SELF EXTRACTING ARCHIVE:

1) Move or save the patch into your main LFS folder
2) Double click the patch to extract it to that folder
3) When you see "Confirm File Replace" select "Yes to All"
4) Now you can start LFS in the normal way

NOTE: You can see if the patch is correctly installed when you run
the program (LFS.exe). At the bottom of the entry screen: 0.7D3


DOWNLOAD:

IF YOU ALREADY HAVE 0.7D:
PATCH 0.7D TO 0.7D3 (SELF EXTRACTING ARCHIVE)
https://www.lfs.net/file_lfs.p ... e=LFS_PATCH_7D_TO_7D3.exe (1.1 MB)
Last edited by Victor, .
Scawen
Developer
Another 12 days have passed and some of you may be interested to read the log. The super short version is I've been fixing things, doing things that needed to be done, getting rid of lists of things to do. I'm trying to get all the important things out of the way ready to focus on tyre physics. Things that are less important, I plan to do after the release (apart from the odd thing here or there that I simply feel like doing).

The attached images show what tyre smoke looks like in a tunnel with and without a lightmap! Big grin


Log of changes:

Some small tasks to finish the delayed texture loading system
- updated per-frame task sequencer so if a car model was built a texture is not loaded
- renamed / reorganised some of the new functions to make more sense when reading code
- prevented delayed texture loading in modeller and vehicle editor (prefer instant)
- fixed single frame with headless driver standing up when exiting animation editor
- the option to switch between compressed and full skins now uses new reload system
- used MP replay to test switching between high and low resolution auto-download skins
- added critical section to make sure DDS saving cannot coincide with loading DDS skin

Spent a day on Fern Bay in the editor - various fixes (not creative work)
- unlike other tracks, Eric does not plan major Fern Bay updates in the near future
- there were shadow holes due to buildings and footbridges without top surfaces
- as an old favourite I wanted to see it in good condition suitable for release
- it's good for me to spend a little time in the track editor occasionally

Fixed minor issue: players joining in entry screen could trigger texture purge events
- host and guests did a quick load and delete of the new player's car to check setup
- as this car was loaded in "in-game" mode it would trigger a check for unused textures
- but cars no longer point to a setup in the player so this seemed to have no purpose
- so instead of preventing the cars triggering a texture purge, simply avoid this code

Off-topic interface update: Provide a left and right arrow for multi-state options
- it bugged me that to switch off replay saving I had to pass through an extra state
- now I can simply click left arrow to switch off saving / right arrow to enable
- the arrow button is greyed out if you reach the last option in that direction
- the 'greyed out' logic was easily applied to option slider bars so did that too
- tempting to do it for the integer nudge buttons but would have to change all calls
- too much to do so will forget that until the inconsistency bugs me in the future

Some development version updates
- new feature to help search for textures in the editor (in objects and world mappings)
- fixed system to load most recent version of a track for a lesson (not exact match)
- update to allow replays to load most recent version of a track (or currently loaded)
- fixed a thread protection notification exiting from editor using the window X button

Training lesson fixes
- fixed start time of training lessons which were always at midnight on 1 January 1601
- fixed some small issues around loading tracks that triggered thread warning messages
- fixed a "Game call from main thread" thread warning message during training lessons

General fixes
- fix for a thread protection notification when LFS does a full D3D recovery
(I have not seen a D3D recovery other than by deliberately forcing it to happen)

Fix for a problem noticed in MPR but would affect multiplayer generally
- symptom was a puff of smoke when clicking timeline to a certain point in the replay
- took a while to track down the cause (depended on where car was before fast forward)
- related to tyre's 'previous ground position' which is compared with current position
- this previous position was wrong if car was at a different angle before pos packet
- this has very minimal difference if pos packet is for a car that is currently viewed
- bigger difference if moving to a car that has not been viewed (physics not updated)
- solution is to get a good estimate for previous position using velocity and rotation
- testing shows that car velocity gives a good estimate so will leave out rotation now

The problem described above took me into angular momentum, rotation, position updates
- some things were still waiting since the 1000Hz updates (on my notes for months)
- now there is no sub-update, some things can be rearranged a little (for accuracy)
- a position accumulator is needed for low speeds (to avoid a 'minimum speed' issue)
- seems good to be pulling me back into physics as the tyre updates are waiting
- converted old variable FloatPos (was related to sub-updates) to position accumulator
- now super-slow speeds are possible and car cannot be stuck on 'digital rails' (xyz)

Have noticed an issue for some time - physics objects resisted starting to move
- seems to be related to 1000Hz update: object velocity not fast enough after 1 frame
- fixed by reducing the speed at which an object is considered to have started moving

Cleaned up code from recent changes / discarded finished notes / browsed old notes
- copied a few things from the old notes onto a short list of tasks to do for release
- although we are still a way from there I want to know what remains other than tyres
- random OT: made arrow keys work to move between options screens (seems like should)
- old notes reminded me that smoke particles do not pick up lighting from lightmap
- the lightmap stores info about artificial light and sky visibility, in an octree
- that means smoke looks black in the night and also too bright in tunnel during day
- made smoke particles read lightmap - see the attached images for before and after
Scawen
Developer
Another week has passed and I've got rid of some more sheets of paper. The bulk of the work was allowing textures to be loaded gradually after the car's 3D model has been built. Initially it was necessary to allow number plates to be updated without rebuilding the car, for the case of a player changing their number plate while their car is on the track. Sounds obscure, but it was the last case of the car mesh being fully rebuilt while already in game. The trick was to keep a different slot for each player so the text on that slot could be updated at any time, so the number plate can change without the car model even being notified.

More obviously important was a system to allow the textures to be loaded in a delayed manner after the car mesh is built. In recent versions, a remote car's model is built only when the car comes into view, but there is a slight glitch at that point (as there always has been). I've now reduced that a lot by initially using existing special system textures for white skins and grey textures, if the texture isn't already in memory. Then the textures are loaded in subsequent frames, one by one. That doesn't take long so now if you see a white car, it won't be for long, and the glitches will be less than they were before.

It probably doesn't sound very exciting but to me it has been quite interesting to see cars loading quickly then their textures rapidly appearing over the next few frames. But I've changed it so when you load a car in the garage or click on someone's car in the game setup screen, it is always an instant load. Also when entering the game in single player or a replay the cars can be fully loaded before presenting the first frame. But for multiplayer we want to get in there as fast as possible as all connected players must be in sync. So in that case you can see cars appearing sequentially (nearest first) then all their textures are loaded and finally the number plates update. It's a better feeling than the long hold on a black screen when everyone has clicked ready.

It seems like most of my immediate notes are going to the paper recycling now. I have to do something to separate the light direction into a physical side (could be used e.g. for track temperatures) and a graphical side. In future that could relate to other weather features. Just like everything else, the physical side needs to be updated by game code and the graphical side will represent or approximate that visually.

A few other things to do and a few bugs to fix, to give me a clear head then maybe I can look at some tyre physics and reassess that, figure out what needs to be adjusted or finished to get nearer to the long awaited release. Thumbs up


Log of changes:

Improved editor colours when showing grids, pit zones, start positions, checkpoints
- makes it easier to find checkpoints as they need to be adjusted on all tracks

Reduced size of vertices sent to GPU by using more efficient storage for normals
- this helps memory bandwidth when drawing each frame and reduces memory usage

Adjustment to number plate system to allow plate to be updated without rebuilding car
- although a rare event this was the last remaining use of old car mesh rebuild system
- previously used to rebuild after a skin download or after pit-out glitch reduction
- now the text can be updated on the number plate texture without car being notified

System to delay loading textures all at once when the car model is built
- this is to replace the old pit-out glitch reduction that had to be removed
- it was never very nice as it resulted in white cars until your own car stopped
- new system creates texture objects in memory initially using a grey system texture
- after the car is loaded, every frame just one car texture is loaded (if not already)
- it was simple enough for the standard dds textures (but complicated a bit by mods)
- more confusing is the use of skins / skins_dds / skins_x / skins_y / mod skin folder
- the trick is to store all settings that control texture load, in the texture object
- changed the temporary texture for skins to white (looks better with user set colours)
- the temporary texture for all other textures remains grey which seems to work well
- number plate textures not updated until next frame after the last texture is loaded
- now car load, model build, texture loads, number plate creation all done separately

Fixed off topic bug: With some vehicles, exposure was noticeably wrong on entering game
- turned out that driver was not created in car setup but only when vehicle first drawn
- so eye position was not available in advance of first frame (used a default position)
- in some vehicles this could put the view in a dark place so exposure turned right up
- a result of exposure adjusting to output image + recent changes to car initialisation
- exposure usually adjusts gradually but it goes instantly to the first frame exposure

Back to the pit-out glitch, the worst remaining glitch is creation of the car model
- much reduced as it does not include loading textures (because of the recent changes)
- more of an issue could be when more than one car model is built in a graphical frame
- for instance turning last corner into pit straight, after some cars joined the race
- seems it should be possible to only allow creation of one car's model in any frame
- this would spread the stutter over a few long frames instead of one really long frame
- tested this by enabling it when entering game - cars appear one by one up the grid
- it's a good test - cars can appear individually then textures appear individually
- now the thing is to stop it happening at times like single player grid or in garage
- nice for me to see the delayed load but it's better not to see that when not needed
Last edited by Scawen, . Reason : correction - the white and grey textures already exist (are not loaded)
Scawen
Developer
Hi, here's some more progress to report. Again, I'll give a short summary and post the diary of updates.

Apart from continuing to make things thread-safe, I think the most interesting thing is a new system to make sure that a good part of the game code and data (the "Race" structure which holds Players and a lot of other data, for the game code) is not accessed by the graphics code, and also a smaller system to make sure the "Snapshot" (which is for rendering 3D and text) is not accessed by the game code. Considering that it would be quite impossible to find every line of code that is accessed in the wrong way, it's a great help to have these systems that can point out such issues whenever I come across them. It also helps me to devise more ways of restructuring the code to enforce thread safety.

Another interesting thing, at least to me Big grin is the live profiling graphs, which you can see in the attached images. LFS has always had one and it helps me to see which code uses a lot of CPU, (either because it's not well optimised or maybe there's a bug there). But it wasn't working recently due to the multithreading. I did have a CPU usage issue that forced me to sort out the multithreading version of the live profiler so I could track down the bug. Now I can select a profiler for the physics or graphics thread. The nice thing is these graphs are hierarchical, so I can click on the + buttons to see inside any section. I guess you'll know what I'm talking about if you have a look at the images. The first image shows the graphics thread CPU usage and the second image shows the physics thread CPU usage.

Here's the diary of updates:

6 Oct
Most of the day on home things (not LFS)
Afternoon / evening looked into the sound updates which can be improved
- in the most recent time graph you can see different length sound updates
- they are roughly in a 2:2:1 pattern, due to sounds being updated in 0.01s blocks
- it would be better to have variable length updates that can match frame lengths

7 Oct
Looked into sound improvements, changed the code to support variable length updates
- encountered various bugs, audio code is sometimes tricky to debug (due to timing)
- final bug was with the echo, realised there is a limit to the size of sound updates
- another obstacle I found is that the audio write point only moves in steps of 0.01s
- so it turns out I can't easily achieve the aim of variable length sound updates
- improvements have allowed me to split the sound updates over multiple physics frames
- another solution could be separate audio thread but it's too much work at the moment
Looked at FF rate - although 1000Hz is possible the options display still read 100Hz
Encountered (and fixed) thread-related crash when refreshing controllers in options
Fixed bug 'Flicker on car reset' which was thread related (wrongly reset draw values)

8 Oct
Morning with family
Looked into an issue where garage screen was initialised by game code when pitting
- that is against the rules of thread-safe behaviour in LFS code
- easily solved using a message from game code to main code to enter garage when safe
Found some bugs in Escape Menu - fixed them and improved the code for future proofing
Fixed thread-related and other minor issues with the Vehicle Editor
Moved position of "AutoJoin" which is for restarting autocross in multiplayer mode
Encountered a crash when second player joins race - related to drawing car alpha

9 Oct
Morning with family
Car alpha crash was due to removal of alpha LOD reset when car reset (bug fix 7 Oct)
- fixed by resetting alpha LOD to "do not draw" when car is created (not on reset)
Came up with another check to find code that is not thread-safe
- access "Race" structure (players, results, etc) through an access function
- this function can check that Race is only accessed from game code (not graphics)
- only trouble is the Race is accessed from around 900 lines of code... get started!
- stopped for the day after updating 400 of these lines to the new style access
- quick test already showed up two bugs for a quick fix and one more to note

10 Oct
Fixed yesterday evening's noted issue and carried on with converting Race references
Actually doing the changes makes me encounter various issues to fix along the way
It occurs to me that the Snapshot should also have the same type of protection as Race
- Race is for Game/Physics code and Snapshot (recently added system) is for graphics
Went ahead with restructuring Snapshot to an access protected version (fairly quick)
- Snapshot now contains a straight copy of the Race structure, excluding Players
- simplifies snapshot creation and makes it easier to convert code to use Snapshot
Stopped updating Race references for the day with only 164 remaining to deal with

11 Oct
Remaining references to Race have been updated to the new style after 2 hours
That is excluding some code related to skin resolution on the Misc Options screen
A race condition is revealed by the new check on switching from game setup to in-game
Also accesses to Race structure while drawing text in-game are revealed by the check
Fixed the text and entering game issues / made some changes to best lap announcement
MPR testing showed up bugs on restarting replay: crashes then invisible world issue
Clicking time bar at later point in replay is sometimes slow, sometimes fast
- learned how to reproduce the slow / fast versions of replay time clicking
- difficulty finding what extra processing takes place in the slow version
- built-in CPU profiler is currently unusable as it is not thread-safe
- looks like time to sort that out and that'll be another thing off the list
- profiler now selectable graphics / physics - used it to find the time clicking bug
Stop for the day, will fix "disappearing world on MPR restart" tomorrow

12 Oct
Fixed disappearing world on MPR restart - probably old bug unrelated to recent changes
- if layout objects were there, the occlusion octree was cleared when replay restarted
- needed to repopulate octree in that case - bug probably there since octree introduced
- for more info about the occlusion Octree see our September 2020 progress report
Back to fixing code that is not thread-safe (some identified by the new systems)
Garage was using (Player in) Race to decide which buttons to draw - now uses Snapshot
Spectate/Join wrongly used Snapshot copy of selected view (should use Game original)
Check for "Join reject" (first 12 seconds of race) needed Game and Snapshot versions
Something related to tyre warmers was called whenever a new Car was created in memory
Fixed that then spent a while cleaning up Car and Engine constructors for efficiency
Scawen
Developer
More gradual progress to report. I don't think this is very interesting reading to most people but at least it shows the sort of thing I have to look into each day.

Attached an image of the updated timeline graph. It has some new colours. The reddish brown colour on the graphics thread is while it has called D3D 'Present' to apply the fully rendered image to the screen. It seems to take a long time to do that each frame because it is with Vertical Sync enabled, so it has to wait for the screen refresh (avoids tearing, and there is no point in having a higher frame rate than the monitor's refresh rate). But even during that time, the graphics card may still be rendering. The end of the blue part is only where LFS has finished sending draw instructions. The nice thing is that, with multithreading, that wait is no problem now, the physics updates keep going on as you can see.

Some gaps in the game/physics thread I believe are because my computer is so old it only has two cores (although it is a good, smooth running PC). I guess the operating system or another program wants to do something, so Windows gives a time slice to that other process instead of continuing with the LFS physics. I believe this might not happen much on a quad core.

Another thing is the audio code (yellow). Although better timed now, seems to take some time and bunch the physics updates. But this is the debug version of the code, it's a lot slower than the release build. So it might not be a problem at all.

Here's the diary of updates for any who are interested. Shrug

30 Sept
Graphical timeline showing what happens on the two threads over one second
- displays concurrency and shows where one thread can hold up the other
- reveals processing time differences between physics updates
- shows the bunching of physics updates by audio updates
- suggests better timing of audio updates

1 Oct
Timing investigation guided by the new graphical timeline
Improved accuracy of the system timer using undocumented ntdll functions
Improved the timeline a bit by adding new elements and adjusting exiting ones
Adjusted the timing of audio updates to avoid interference with the sync point

2 Oct
Adjusted game code to allow interruption of bunched physics updates for a sync point
Noticed that downloaded mods and skins are not reloaded in the best place (noted)
Made wait for sync point *always* interrupt overloaded physics (avoids visual hangs)
Noticed that game reset while physics objects moving calls D3D code 'illegally' (noted)

3 Oct
Investigating a known fault related to timer resetting when no guests are connected
Noticed some sync check values had not been updated for the 1000Hz physics update
Made some general improvements, simplified the timer reset code and fixed the bug
Moved reload of downloaded mods and cars with updated skins to the sync point
Fixed an already noted issue with auto restart on exiting the pits in hotlap mode

4 Oct
Spent some time looking at ways to delay the loading of textures when loading a car
- it would be better not do so any D3D work while loading a car but it's complicated
- some of the physics code (aero positions) depends on the 3D model being built
- possible solution is for the model to be built by game code but delay texture loading
Put that on the back burner for a while and looked at VR in the multithreading system
- found some issues including time appearing to slow down
- realised this is due to an oversight in the changes made on 2 August
- corrected that, continued VR testing, fixed a couple of bugs
Continued VR testing, looking at timing graph, experimenting

5 Oct
Another VR day, did research, testing, tried a different approach from yesterday
Ended up with good smooth results on tracks where my computer is fast enough
Did a substantial test on VR and FF wheel, driving at Bancroft and Fairfield
Force feedback can also be output at 1000 Hz with the physics updates
Seemed to feel higher resolution on the G27, I guess it could be good on DD wheel
Read through lists of things to do, would like to get a few crossed off tomorrow
Last edited by Scawen, . Reason : not August... it's October - thanks Yisc[NL]
FGED GREDG RDFGDR GSFDG